//
//  Object.h
//  TrackingSim
//
//  Created by Garrett Manka on 1/28/12.
//  Copyright (c) 2012. All rights reserved.
//

#ifndef TrackingSim_Object_h
#define TrackingSim_Object_h

#include <math/Vector.h>
#include <graphics/Material.h>
#include <graphics/Face.h>
#include <vector>
#include <string>
#include <map>

typedef Sim::Vector Vertex;
typedef Sim::Vector Normal;

class Object
{
public:
    Object();
    
    void setName( const std::string& name );
    void setMeshGroup( const std::string& mesh_group );
    void setGroupID( int group_id );
    void addVertex( const Vertex& v , int abs_vertex_index );
    void addNormal( const Normal& n , int abs_normal_index );
    void addFace( const Face& f );
    
    const std::string& getName() const;
    const std::string& getMeshGroup() const;
    const int getGroupID() const;
    
    const std::vector<Vertex>& getVertexList() const;
    const std::vector<Normal>& getNormalList() const;
    const std::vector<Face>& getFaceList() const;
    int getLocalVertexIndex( int abs_vertex_index );
    int getLocalNormalIndex( int abs_normal_index );
    
private:
    
    std::string m_name;
    std::string m_mesh_group;
    int m_group_id;
    std::vector<Vertex> m_vertex_list;
    std::vector<Normal> m_normal_list;
    std::vector<Face> m_face_list;
    std::vector<Material> m_material_list;
    std::map<int,int> m_absolute_vertex_index_map;
    std::map<int,int> m_absolute_normal_index_map;
};

#endif
